<?php 

class GetXiaMiMusicNameFromArtist extends GetXiaMiMusicName {
    
    //提取专辑名字
    public function extractCdName(){
        parent::extractCdName();
        
        $this->_cd->setCdName('热门歌曲');
    }

    //提取专辑名字在虾米的Id
    public function extractCdNameId(){
        parent::extractCdNameId();
        
        $this->_cd->setCdNameId(0);
    }

    //提取专辑艺人在虾米的Id
    public function extractCdArtistId() {
        parent::extractCdArtistId();

        $urlInfo    = explode('/', $this->_url);
        $this->_cd->setCdArtistId(array_pop($urlInfo));
    }

    //提取专辑描述信息
    public function extractCdDescription() {
        parent::extractCdDescription();

        $cdDescription  = 'No Description.';
        $cdDescriptionMode  = '/id="artist_info">(.*)<div\sid="artist_radio">/simx';
        if(preg_match($cdDescriptionMode, $this->_urlHtmlContent, $matchItems)) {
            $cdDescription  = $matchItems[1];
            $cdDescription  = LittleTools::replaceRowTagToN($cdDescription);
            $cdDescription  = LittleTools::filterHtmlTag($cdDescription);
            $cdDescription  = LittleTools::filterSpace($cdDescription);
        }
        $this->_cd->setCdDescription($cdDescription);
    }

}

?>
